package com.zxy.ziems.server.board.controller;

import com.zxy.btp.common.response.JsonResponse;
import com.zxy.ziems.server.board.pojo.vo.ClassifyDosageVo;
import com.zxy.ziems.server.board.pojo.vo.EnergyTrendVo;
import com.zxy.ziems.server.board.pojo.vo.EnergyTop5Vo;
import com.zxy.ziems.server.board.service.EnergyBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 能源看板
 * @author bikeq
 *
 */
@RestController
@RequestMapping("/api/dataBoard/energy")
public class EnergyBoardController {
    @Autowired
    private EnergyBoardService energyBoardService;

    /**
     * 昨日消化排行top5
     * @return
     */
    @RequestMapping("/getTop5")
    public JsonResponse<EnergyTop5Vo> getTop5() {

        return JsonResponse.SUCCESS(energyBoardService.getEnergyTop5());
    }

    /**
     * 当月分类用量
     * @return
     */
    @GetMapping("/getCurMonth")
    public JsonResponse<ClassifyDosageVo> getCurMonthBoard() {
        return JsonResponse.SUCCESS(energyBoardService.getCurMonthBoard());
    }

    /**
     * 近七日趋势
     * @return
     */
    @GetMapping("/getSevenTrend")
    public JsonResponse<EnergyTrendVo> getSevenTrend() {
        return JsonResponse.SUCCESS(energyBoardService.getSevenTrend());
    }

    /**
     * 月趋势
     * @return
     */
    @GetMapping("/getMonthTrend")
    public JsonResponse<EnergyTrendVo> getMonthTrend() {
        return JsonResponse.SUCCESS(energyBoardService.getMonthTrend());
    }
}
